<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditVentaTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditVentaLabel_cantidadVenta}" for="cantidadVenta" />
                    <h:inputText id="cantidadVenta" value="#{ventaController.selected.cantidadVenta}" title="#{bundle.EditVentaTitle_cantidadVenta}" required="true" requiredMessage="#{bundle.EditVentaRequiredMessage_cantidadVenta}"/>
                    <h:outputLabel value="#{bundle.EditVentaLabel_montoVenta}" for="montoVenta" />
                    <h:inputText id="montoVenta" value="#{ventaController.selected.montoVenta}" title="#{bundle.EditVentaTitle_montoVenta}" required="true" requiredMessage="#{bundle.EditVentaRequiredMessage_montoVenta}"/>
                    <h:outputLabel value="#{bundle.EditVentaLabel_iva10}" for="iva10" />
                    <h:inputText id="iva10" value="#{ventaController.selected.iva10}" title="#{bundle.EditVentaTitle_iva10}" required="true" requiredMessage="#{bundle.EditVentaRequiredMessage_iva10}"/>
                    <h:outputLabel value="#{bundle.EditVentaLabel_fechaVenta}" for="fechaVenta" />
                    <h:inputText id="fechaVenta" value="#{ventaController.selected.fechaVenta}" title="#{bundle.EditVentaTitle_fechaVenta}" required="true" requiredMessage="#{bundle.EditVentaRequiredMessage_fechaVenta}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditVentaLabel_idUsuarioVendedor}" for="idUsuarioVendedor" />
                    <h:selectOneMenu id="idUsuarioVendedor" value="#{ventaController.selected.idUsuarioVendedor}" title="#{bundle.EditVentaTitle_idUsuarioVendedor}" required="true" requiredMessage="#{bundle.EditVentaRequiredMessage_idUsuarioVendedor}">
                        <f:selectItems value="#{usuarioController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditVentaLabel_idProductoVenta}" for="idProductoVenta" />
                    <h:selectOneMenu id="idProductoVenta" value="#{ventaController.selected.idProductoVenta}" title="#{bundle.EditVentaTitle_idProductoVenta}" required="true" requiredMessage="#{bundle.EditVentaRequiredMessage_idProductoVenta}">
                        <f:selectItems value="#{productoController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditVentaLabel_idCliente}" for="idCliente" />
                    <h:selectOneMenu id="idCliente" value="#{ventaController.selected.idCliente}" title="#{bundle.EditVentaTitle_idCliente}" required="true" requiredMessage="#{bundle.EditVentaRequiredMessage_idCliente}">
                        <f:selectItems value="#{clienteController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{ventaController.update}" value="#{bundle.EditVentaSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditVentaViewLink}"/>
                <br />
                <h:commandLink action="#{ventaController.prepareList}" value="#{bundle.EditVentaShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.EditVentaIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
